/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: union.c
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月16日 星期三 10时56分32秒
***************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

union ip_mem {
	    int addr;
		char s[4];
};

int main(int argc,const char* argv[])
{
	union ip_mem ip;
	ip.addr = 0x12345678;
	printf("%x,%x,%x,%x\n", ip.s[0],ip.s[1],ip.s[2],ip.s[3]);

    return 0;
}
